package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.daos.OrderMapper;
import com.project.entity.Order1;
import com.project.entity.Stall;
import com.project.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public PageInfo<Order1> getAllOrderByUid(Integer uid,Integer currentPage,Integer pageSize,String stall_code) {
        PageHelper.startPage(currentPage,pageSize);
        List<Order1> orderList = orderMapper.getAllOrderByUid(uid,stall_code);
        PageInfo<Order1> pageInfo = new PageInfo<>(orderList);
        return pageInfo;
    }
}
